home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 6 / QRZ Ham Radio Callsign Database - Volume 6.iso / pc / files / mac / sftkisrc.hqx / SoftKiss.src.1.8 / dbo / dbo_stdio.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-12  |  2.3 KB  |  108 lines

  1. /*
  2.  * dbo_stdout.h - debugging print system
  3.  * by Aaron Wohl
  4.  * Public domain
  5.  * 6393 Penn Ave #303
  6.  * Pittsburgh PA, 15208
  7.  * home: 412-731-6159
  8.  * work: 412-268-5032
  9.  */
  10.  
  11. #include <stdarg.h>
  12.  
  13. #ifndef DBO_ENABLED
  14. #define DBO_printf(xx_arg)
  15. #define DBO_fprintf(xx_arg)
  16. #define DBO_CLEAR
  17. #define dbo_fopen(xx_arg)
  18. #define dbo_fputc(xx_arg,xx_arg2)
  19. #define dbo_goto(xx_arg1,xx_arg2)
  20. #define dbo_fgoto(xx_arg1,xx_arg2,xx_arg3)
  21. #define dbo_fclear(xx_arg)
  22. #else
  23. #define dbo_stdout (0L)            /*default output window*/
  24.  
  25. #define DBO_printf(xx_arg) dbo_printf xx_arg
  26. #define DBO_fprintf(xx_arg) dbo_fprintf xx_arg
  27. #define DBO_CLEAR dbo_clear()
  28.  
  29. /*
  30.  * constants at start/end of file record
  31.  * for consistancy/overwrite checking
  32.  */
  33. #define dbo_GUARD1 (0x48F2)
  34. #define dbo_GUARD2 (0x7235)
  35.  
  36. /*
  37.  * dbo equivilant of FILE
  38.  */
  39. struct dbo_FILE_R {
  40.     unsigned short dbo_guard1;    /*constant so we know this is inited ok*/
  41.     int just_kidding;            /*don't print anything*/
  42.     unsigned char *mem;            /*address of screen*/
  43.     unsigned long row_bytes;    /*bytes per row in mem*/
  44.     short nl_extra;                /*extra bytes to clear on new line*/
  45.     short plimit;                /*char output limit per printf*/
  46.     short int_is4;                /*true if integers are 4bytes*/
  47.     Point win_tl;                /*top left address of window*/
  48.     Point win_br;                /*bottom right address of window*/
  49.     Point win_cur;                /*current cursor*/
  50.     unsigned char wrap;            /*wrap output lines if non zero*/
  51.     long resv[4];                /*reserved for internal use/expansion*/
  52.     unsigned short dbo_guard2;    /*constant so we know this is inited ok*/
  53. };
  54. typedef struct dbo_FILE_R dbo_FILE,*dbo_FILE_pt;
  55.  
  56. /*
  57.  * initialize the passed dbo file for full screen
  58.  * on startup screen
  59.  */
  60. void dbo_fopen(dbo_FILE_pt af);
  61.  
  62. /*
  63.  * write one character to a file
  64.  */
  65. void dbo_fputc(register dbo_FILE_pt af,char ch);
  66.  
  67. /*
  68.  * v array version of printf
  69.  */
  70. int dbo_vfprintf(dbo_FILE_pt af,const char *fmt,va_list ap);
  71.  
  72. /*
  73.  * debugging fprintf
  74.  */
  75. int dbo_fprintf(dbo_FILE *fp,const char *fmt,...);
  76.  
  77. /*
  78.  * debugging vprintf
  79.  */
  80. int dbo_vprintf(const char *fmt,void *p);
  81.  
  82. /*
  83.  * debugging printf
  84.  */
  85. int dbo_printf(const char *fmt,...);
  86.  
  87.  
  88. /*
  89.  * position cursor in the stdout dbo window
  90.  */
  91. void dbo_goto(int x,int y);
  92.  
  93. /*
  94.  * position cursor in a dbo window
  95.  */
  96. void dbo_fgoto(dbo_FILE *fp,int x,int y);
  97.  
  98. /*
  99.  * clear window
  100.  */
  101. void dbo_clear(void);
  102.  
  103. /*
  104.  * clear file window
  105.  */
  106. void dbo_fclear(dbo_FILE *af);
  107. #endif
  108.